// pages/collect/collect.js
Page({
  data: {
    tabs: [
      { id: 0, value: '商品收藏', isActive: true },
      { id: 1, value: '店铺收藏', isActive: false },
      { id: 2, value: '喜欢', isActive: false },
      { id: 3, value: '浏览足迹', isActive: false }
    ],
    collectList: []
  },
  onLoad: function (options) {
    console.log(options);
  },
  onTabsItemChange(e) {
    console.log(e);
    // 拿到激活的index
    const { index } = e.detail
    let { tabs } = this.data
    tabs.forEach((v, i) => {
      i === index ? v.isActive = true : v.isActive = false
    })
    this.setData({ tabs })
  },
  onShow() {
    const collectList = wx.getStorageSync("collectList");
    this.setData({ collectList })
  }

})